package model

import "github.com/gogf/gf/v2/os/gtime"

type UserListInput struct {
	Username string `json:"username" dc:"用户名"`
	Nickname string `json:"nickname" dc:"昵称"`
	Status   string `json:"status" v:"in:0,1#状态参数不合法" dc:"状态"`
	PageSizeReq
}

type UserListItem struct {
	Id         uint64      `json:"id"`
	Username   string      `json:"username"`
	Nickname   string      `json:"nickname"`
	Mobile     string      `json:"mobile"`
	Email      string      `json:"email"`
	Avatar     string      `json:"avatar"`
	Sex        uint        `json:"sex"`
	UserStatus uint        `json:"user_status"`
	CreatedAt  *gtime.Time `json:"created_at"`
}

type UserItem struct {
	Id         uint64 `json:"id"`
	Username   string `json:"username"`
	Nickname   string `json:"nickname"`
	Mobile     string `json:"mobile"`
	Email      string `json:"email"`
	Sex        uint   `json:"sex"`
	Remark     string `json:"remark"`
	UserStatus uint   `json:"user_status"`
	Role       string `json:"role" dc:"角色"`
}

type UserFormInput struct {
	Username     string `json:"username" v:"required|max-length:30" dc:"用户名"`
	Nickname     string `json:"nickname" v:"required|max-length:30" dc:"昵称"`
	PasswordHash string `json:"password_hash" v:"required-without:id" dc:"密码，不传则不修改"`
	Mobile       string `json:"mobile" v:"phone" dc:"手机号"`
	Email        string `json:"email" v:"email" dc:"email"`
	Sex          uint   `json:"sex" v:"integer|in:0,1,2" dc:"性别"`
	Remark       string `json:"remark" v:"max-length:150" dc:"备注"`
	UserStatus   uint   `json:"user_status" v:"integer|in:0,1" dc:"状态"`
	Role         string `json:"role" dc:"角色"`
}
